package com.galaxis.wms.query;

import com.galaxis.wms.entity.SysUserResource;
import com.querydsl.core.types.Path;
import com.querydsl.core.types.PathMetadata;
import com.querydsl.core.types.dsl.DateTimePath;
import com.querydsl.core.types.dsl.NumberPath;
import com.querydsl.core.types.dsl.StringPath;
import com.querydsl.sql.ColumnMetadata;
import com.querydsl.sql.RelationalPathBase;

import java.sql.Timestamp;
import java.sql.Types;

import static com.querydsl.core.types.PathMetadataFactory.forVariable;

/**
 * 用户资源关联表(sys_user_resource)
 */
@SuppressWarnings("ALL")
public class QSysUserResource extends RelationalPathBase<SysUserResource> {
    /** sys_user_resource表 */
    public static final QSysUserResource sysUserResource = new QSysUserResource("sys_user_resource");

    /** 用户ID */
    public final NumberPath<Long> userId = createNumber("userId", Long.class);
    /** 资源ID */
    public final NumberPath<Long> resourceId = createNumber("resourceId", Long.class);
    /** 创建人 */
    public final StringPath createBy = createString("createBy");
    /** 创建时间 */
    public final DateTimePath<Timestamp> createAt = createDateTime("createAt", Timestamp.class);
    /** 更新人 */
    public final StringPath updateBy = createString("updateBy");
    /** 更新时间 */
    public final DateTimePath<Timestamp> updateAt = createDateTime("updateAt", Timestamp.class);

    QSysUserResource(String variable) {
        super(SysUserResource.class, forVariable(variable), "public", "sys_user_resource");
        addMetadata();
    }

    QSysUserResource(String variable, String schema, String table) {
        super(SysUserResource.class, forVariable(variable), schema, table);
        addMetadata();
    }

    QSysUserResource(String variable, String schema) {
        super(SysUserResource.class, forVariable(variable), schema, "sys_user_resource");
        addMetadata();
    }

    QSysUserResource(Path<? extends SysUserResource> path) {
        super(path.getType(), path.getMetadata(), "public", "sys_user_resource");
        addMetadata();
    }

    QSysUserResource(PathMetadata metadata) {
        super(SysUserResource.class, metadata, "public", "sys_user_resource");
        addMetadata();
    }

    void addMetadata() {
        addMetadata(userId, ColumnMetadata.named("user_id").withIndex(1).ofType(Types.BIGINT).withSize(19));
        addMetadata(resourceId, ColumnMetadata.named("resource_id").withIndex(2).ofType(Types.BIGINT).withSize(19));
        addMetadata(createBy, ColumnMetadata.named("create_by").withIndex(3).ofType(Types.VARCHAR).withSize(64));
        addMetadata(createAt, ColumnMetadata.named("create_at").withIndex(4).ofType(Types.TIMESTAMP).withSize(35).withDigits(6));
        addMetadata(updateBy, ColumnMetadata.named("update_by").withIndex(5).ofType(Types.VARCHAR).withSize(64));
        addMetadata(updateAt, ColumnMetadata.named("update_at").withIndex(6).ofType(Types.TIMESTAMP).withSize(35).withDigits(6));
    }
}

